package org.HU.train.member.request.member;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;

/**
 * @Author ZUZ
 * @Description: TODO
 * @Date 2024-12-18 20:35
 * @ClassName: MemberLoginReq
 */
public class MemberLoginReq {

    //要求mobile不能为空,用了这个注解之后还需要在controller层的对应地方加上@Valid注解
    @NotBlank(message = "手机号不能为空")
    //验证输入格式是否正确，要求第一位是1，后面是十位数字
    @Pattern(regexp = "^1\\d{10}$", message = "手机号码格式错误")
    private String mobile;


    @NotBlank(message = "短信验证码不能为空")
    private String code;

    @Override
    public String toString() {
        return "MemberLoginReq{" +
                "mobile='" + mobile + '\'' +
                ", code='" + code + '\'' +
                '}';
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

}
